package containerleran;

public class StringTest {
	private int m;
	int count ;
	public StringTest(StringTest s){
		this.m = s.m;
	}
	public StringTest(){
		m = 0;
	}
	public void test(int m ){
		
	}
	public void Print()throws RuntimeException{
		System.out.println("Print function result is :" + this);
//		count = 0;
		//here the + this will be treated as this.toString();
	}
	public String toString(){
//		return "toString function result is : "+ super.toString();
		if(count<0){
			count = 0;
		}
		count++;
		StringBuffer sb = new StringBuffer();
		sb.append("toString function result is :");
		if(count<10){
			sb.append(" "+this);
		}else{
			sb.append(super.toString());
		}
		return sb.toString();
	}
}
